//
//  Helps.h
//  Login
//
//  Created by mac on 17/3/1.
//  Copyright © 2017年 ZF. All rights reserved.
//

//输出运行时间
#define TIMR_START   NSDate *startTime = [NSDate date]
#define TOCK_ENT   NSLog(@"Time: %f", -[startTime timeIntervalSinceNow])

// 当前设备屏幕 宽/高
#define ScreenWidth [UIScreen mainScreen].bounds.size.width
#define ScreenHeight [UIScreen mainScreen].bounds.size.height

// 设置颜色
#define COLOR(R, G, B, A) [UIColor colorWithRed:R/255.0 green:G/255.0 blue:B/255.0 alpha:A]

// 获取String的绘制大小
#define STRING_SIZE_BY_WIDTH(_width_, _hight_,_string_, _fontSize_) [_string_ boundingRectWithSize:CGSizeMake(_width_, _hight_) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName: [UIFont systemFontOfSize:_fontSize_]} context:nil].size

#define SHOW_HUD(_TIPS_, _VIEW_, _Y_) [Helps showWaitHUDTips:_TIPS_ inView:_VIEW_ yOffset:_Y_]

//#define SHOW_ALERTCON(_message_) UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"提示" message:_message_ preferredStyle:UIAlertControllerStyleAlert]; \
//[alert addAction:[UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleCancel handler:nil]]; \[self presentViewController:alert animated:YES completion:nil];\

#define SHOW_ALERT(_message_) UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"温馨提示" message:_message_ delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定" ,nil]; \
[alert show];\


#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
#import "MBProgressHUD.h"

@interface Helps : NSObject

+ (AppDelegate *)app;

+ (MBProgressHUD *)showWaitHUDTips:(NSString *)tips yOffset:(CGFloat)y;

+ (void)showTips:(NSString *)tips forTime:(NSTimeInterval)time inView:(UIView *)view yOffset:(CGFloat)y;

+ (void)showTips:(NSString *)tips forTime:(NSTimeInterval)time yOffset:(CGFloat)y;

+ (UIWindow *)window;

+ (UITabBarController *)getTabCon;

+ (UIViewController *)getCurrentViewController;

+ (void)setNaviControllerRootView;
@end
